package com.easyJavaDemo.mapper;

import com.easyJavaDemo.entity.po.Goods;
import com.easyJavaDemo.entity.query.GoodsQuery;
import org.apache.ibatis.annotations.Param;

/**
 * 商品表Mapper
 */
public interface GoodsMapper extends BaseMapper<Goods, GoodsQuery> {
	/**
	 * 根据Id查询
	 */
	Goods selectById(@Param("id") Integer id);

	/**
	 * 根据Id修改
	 */
	int updateById(@Param("bean") Goods goods, @Param("id") Integer id);

	/**
	 * 根据Id删除
	 */
	int deleteById(@Param("id") Integer id);

	/**
	 * 根据NameAndPrice查询
	 */
	Goods selectByNameAndPrice(@Param("name") String name, @Param("price") Integer price);

	/**
	 * 根据NameAndPrice修改
	 */
	int updateByNameAndPrice(@Param("bean") Goods goods, @Param("name") String name, @Param("price") Integer price);

	/**
	 * 根据NameAndPrice删除
	 */
	int deleteByNameAndPrice(@Param("name") String name, @Param("price") Integer price);

}
